<?php
/*
 * @Author: 杨红兵 
 * @Date: 2022-07-13 13:47:01 
 * @Last Modified by: 杨红兵
 * @Last Modified time: 2022-07-13 13:48:03
 */

namespace app\libraries\utils\traits;

use think\Container;

trait Signleton
{
    /**
     * 单例模式
     *
     * @return static
     */
    public static function getInstance(...$args)
    {
        return Container::getInstance()->make(static::class, $args, false);
    }

    /**
     * 清除绑定实例
     *
     * @Author YangHB
     * @DateTime 2021-11-02 20:50:10
     *
     * @return void
     */
    public static function deleteInstance()
    {
        Container::getInstance()->delete(static::class);
    }
}
